package webTest.sessionCookie.Session;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by IFT8 on 2015/2/2.
 */
public class GoodsDAO {
    private GoodsDAO() {

    }

    private static Map<String, Goods> goodses = new HashMap<String, Goods>();

    static {
        goodses.put("1", new Goods("1", "洗衣机", 2500));
        goodses.put("2", new Goods("2", "电视机", 1700));
        goodses.put("3", new Goods("3", "空调", 3200));
        goodses.put("4", new Goods("4", "冰箱", 2000));
    }

    public static Map<String, Goods> getGoodses() {
        return goodses;
    }

    public static Goods getGoods(String id) {
        return getGoodses() != null ? getGoodses().get(id) : null;
    }
}
